var common = require('../common');
var net = require('net');


var SignIn = function(app) {
	app.get('/:gameId/SignIn', function(req, res) {
		var sock = net.createConnection(parseInt(process.argv[3]), process.argv[2], function() {
			sock.write("<request id=\"asdf\"><connectRequest id=\"asdf\"/></request>\n");
		});
		
		sock.on('data', function(data) {
			console.log(req.params.gameId + ": " + data.toString());
			res.setHeader('content-type', 'text/plain');
			res.send(data);
			sock.end();
		});
	});
};

module.exports = SignIn;